# -*- coding: UTF8 -*-
# Author: Sakurazaki
# (Aitor Martin. @arienai_ne - sakurazaki.setsunita@gmail.com)

class Vector2D(object):

    def __init__(self, x = 0.0, y = 0.0):
        if x.__class__ in (list,tuple):
            self.x = x[0]
            self.y = x[1]
        else:
            self.x = x
            self.y = y

    def get(self):
        return (self.x, self.y)

    def __repr__(self):
        return "Vector2D(%s, %s)" % (self.x, self.y)

    def __add__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x + dv[0], self.y + dv[1])
        else:
            return Vector2D(self.x + dv.x, self.y + dv.y)

    def __iadd__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x + dv[0], self.y + dv[1])
        else:
            return Vector2D(self.x + dv.x, self.y + dv.y)

    def __sub__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x - dv[0], self.y - dv[1])
        else:
            return Vector2D(self.x - dv.x, self.y - dv.y)

    def __isub__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x - dv[0], self.y - dv[1])
        else:
            return Vector2D(self.x - dv.x, self.y - dv.y)

    def __mul__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x * dv[0], self.y * dv[1])
        else:
            return Vector2D(self.x * dv.x, self.y * dv.y)

    def __imul__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x * dv[0], self.y * dv[1])
        else:
            return Vector2D(self.x * dv.x, self.y * dv.y)

    def __floordiv__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x // dv[0], self.y // dv[1])
        else:
            return Vector2D(self.x // dv.x, self.y // dv.y)

    def __ifloordiv__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x // dv[0], self.y // dv[1])
        else:
            return Vector2D(self.x // dv.x, self.y // dv.y)

    def __truediv__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x / dv[0], self.y / dv[1])
        else:
            return Vector2D(self.x / dv.x, self.y / dv.y)

    def __itruediv__(self, dv):
        if dv.__class__ in (list,tuple):
            return Vector2D(self.x / dv[0], self.y / dv[1])
        else:
            return Vector2D(self.x / dv.x, self.y / dv.y)
